package com.lft.freshordering.utils;

/**
 * @author lishiyan
 * @since 2024-07-12         11:12:53 星期五
 */

public enum AuditStatus {
    APPROVED(1, "审核通过"),
    REJECTED(2, "不通过"),
    PENDING(3, "待审核");

    private final int code;
    private final String description;

    AuditStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AuditStatus fromCode(int code) {
        for (AuditStatus status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return null;
    }
}
